<?php
//include('conn.php');
// if(!isset($_POST['submit']))
// {
// 	exit("Method error!");
// }
$conn = mysqli_connect("localhost:3306","root","lks112700.");
if(!$conn){
	die("数据库连接失败:".mysql_error());
}
mysqli_select_db("person",$conn);
$std_tel_num = $_POST['std_tel_num'];
	// echo $std_tel_num;
$std_paw = $_POST['std_paw'];
$std_wechat = $_POST['std_wct'];
$std_name = $_POST['std_name'];
$std_addr = $_POST['std_addr'];
$std_email = $_POST['std_email'];
// if(strlen($std_tel_num)!=11)
// {
// 	exit("错误：手机号码长度错误!");
// }
// if(preg_match('/^[a-zA-Z0-9\._+]+@[A-Za-z0-9]+\.[a-zA-Z]+$/', $std_email) == 0 )
// {
// 	exit("错误：电子邮箱格式错误!");
// }
// if(strlen($std_paw) < 6)
// {
// 	exit("错误：密码长度太短！");
// }
// $check_query = mysql_query("select id from user where std_email='$std_email'");
// if(mysql_fetch_array($check_query))
// {
// 	exit("Email already exists!");
// }

$sql = "INSERT INTO user(std_tel_num,std_paw,std_wechat,std_name,std_addr,std_email)VALUES('$std_tel_num','$std_paw','$std_wechat','$std_name','$std_addr','$std_email')"; 
$query = mysqli_query($sql,$conn);

if($query)
{
	echo urlencode(json_encode('susscese':'1'));
}
else
{
	echo urlencode(json_encode('susscese':'0'));
}
?>